package system

import (
	"github.com/gin-gonic/gin"
	v1 "main.go/api/v1"
	"main.go/middleware"
)

type UserRouter struct{}

func (r *UserRouter) InitUserRouter(Router *gin.RouterGroup) {
	group := Router.Group("user")
	privateGroup := Router.Group("user").Use(middleware.Auth("admin"))
	api := v1.ApiGroupApp.SystemApiGroup.UserApi
	{
		privateGroup.POST("changePassword", api.ChangePassword) // 用户修改密码
		privateGroup.POST("resetPassword", api.ResetPassword)   // 用户修改密码
		privateGroup.POST("create", api.Create)                 // 增
		privateGroup.POST("delete", api.Delete)                 // 删
		privateGroup.POST("update", api.Update)                 // 改
		privateGroup.POST("list", api.List)                     // 查
		privateGroup.GET("userInfo", api.UserInfo)              // 查

	}
	{
		group.POST("login", api.Login)
	}
}
